﻿<?php 
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/product_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$pd=new product();

if (isset($_POST["Submit"])&&$_POST["Submit"]!="")
{
	if ($_POST["classname"]==""){$mc->msg("类别不能为空","go");}
	
	if($pd->cata_add($_POST["classname"],$_POST["pid"],$_POST["content"])){
	$mc->msg("添加成功","product_class.php?classid=".$_GET['classid']);
	}else{
	$mc->msg("添加失败","product_class.php?classid=".$_GET['classid']);	
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>格灵早教后台管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td  align="right"><img src="../images/weizhleft.png" width="12" height="45" /></td>
            <td width="100%" style="background:url(../images/weizhimid.png) repeat-x"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="55%">当前: 类别管理 &gt; 添加类别</td>
              </tr>
            </table></td>
            <td width="1%" align="right" ><img src="../images/weizhiright.png" width="12" height="45" /></td>
          </tr>
        </table>
        </td>
      </tr>
</table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">
  
  
  <tr>
    <td width="11%" height="50" align="right">类别名称：</td>
    <td height="50"><input name="classname" type="text" id="classname" ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle" >上级类别：</td>
    <td height="50" valign="middle" ><select name="pid" id="pid">
          <option value="0">无</option>
          <?php
          $db->depth=0;
          $twhere="";
          $db->getchild("product_class",0,$mc->Ismp($_GET["id"]),"ID",".",$twhere);
          ?>
        </select><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">类别排列：</td>
    <td height="50" valign="middle"><input name="classorder" type="text" id="classorder" value="0" ><Font>
   (必须为数字)</Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">备注说明：</td>
    <td height="50" valign="middle"><textarea name="content" id="content" cols="30" rows="2"></textarea>
      <Font>
   </Font></td>
    </tr>

  <tr>
    <td height="50" align="right" valign="middle">&nbsp;</td>
    <td height="50" valign="middle"><bdo>
      <input type="submit" name="Submit" value="提交"> <input type="button" name="Submit2" value="返回" onClick="location.href='product_class.php'">
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>
